home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / DELPHI32 / FORM_UTL / MINMAX / EXAMPLE.ZIP / Unit1.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1996-08-15  |  1.0 KB  |  52 lines

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls,
  8.   MinMax;
  9.  
  10. type
  11.   TForm1 = class(TForm)
  12.     Label1: TLabel;
  13.     MinMax1: TMinMax;
  14.     Label2: TLabel;
  15.     CheckBox1: TCheckBox;
  16.     procedure FormCreate(Sender: TObject);
  17.     procedure CheckBox1Click(Sender: TObject);
  18.   private
  19.     { DΘclarations privΘes }
  20.   public
  21.     { DΘclarations publiques }
  22.   end;
  23.  
  24. var
  25.   Form1: TForm1;
  26.  
  27. implementation
  28.  
  29. {$R *.DFM}
  30.  
  31. procedure TForm1.FormCreate(Sender: TObject);
  32. var
  33.   Tmp: String;
  34. begin
  35.   FmtStr(Tmp, 'Min : (%d, %d)',
  36.           [MinMax1.MinTrackSize.X, MinMax1.MinTrackSize.Y]);
  37.   Label1.Caption := Tmp;
  38.   FmtStr(Tmp, 'Max : (%d, %d)',
  39.           [MinMax1.MaxTrackSize.X, MinMax1.MaxTrackSize.Y]);
  40.   Label2.Caption := Tmp;
  41. end;
  42.  
  43. procedure TForm1.CheckBox1Click(Sender: TObject);
  44. begin
  45.   if CheckBox1.Checked then
  46.     MinMax1.Options := MinMax1.Options + [opAllowResize]
  47.   else
  48.     MinMax1.Options := MinMax1.Options - [opAllowResize];
  49. end;
  50.  
  51. end.
  52.